<?php

class Admin_MenuitemController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
 
    }

    public function addAction()
    {
    	$mtenu=$this->_request->getParam('menu');
     	$mdIMenu= new Model_Menu ();
     	$this->view->menu= $mdIMenu-> find($menu)->current();
     	$frmMenuItem= new Form_MenuItem ();
     	$frmMenuItem->populate(array('menu_id'=> $menu));
     	$this->view->form = $frmMenuItem;
    }
    public function addItem ($menuId, $label, $pageId = 0, $url=null)
    {
     
        $id = 'menu_' . $menuId;
        $cache->remove($id);
        $row = $this->createRow();
        $row->menu_id = $menuId;
        $row->label = $label;
        $row->page_id = $pageId;
        $row->url = $url;
        $row->position = $this->_getLastPosition($menuId) + 1;
        return $row->save();
    }
   
}





